|
|
|
|
|
|
|
Now all you need to do is modify the cmdSalesRep_Click event of the frmTest form to test out these new properties. Switch to the prjTest project and add the code from Listing 11.28 to the cmdSalesRep_Click event. |
|
|
|
|
|
|
|
|
Listing 11.28. Updating the cmdSalesRep_Click event. |
|
|
|
|
|
|
|
|
Private Sub cmdRepSales_Click()
'
' test graph libaray
'
Dim objDG As Object
'
Set objDG = New DataGraph
'
objDG.DatabaseName = App.Path & "\..\..\data\books5.mdb"
objDG.sqlselect = "SELECT SalesRep, SUM(Units) AS UnitsSold FROM BookSales
GROUP BY SalesRep"
objDG.graphfield = "UnitsSold"
objDG.graphTitle = "Units Sold by Sales Rep"
'
' added properties
objDG.labelfield = "SalesRep"
objDG.lefttitle = "Units Sold"
objDG.bottomtitle = "Sales Reps"
objDG.legendfield = "SalesRep"
'
objDG.showgraph
'
End Sub |
|
|
|
|
|
|
|
|
Save and run the PRJTEST.VBP project. When you click the SalesRep button, your screen should look like the one shown in Figure 11.12. |
|
|
|
|
|
|
|
|
Figure 11.12.
Viewing the updated graph object display. |
|
|
|
|
|